﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using KFGame;

/// <summary>
///  盘键键位模拟值，valueInt valufloat valueString 
///  自行识别类型使用
/// </summary>
public class KeyEventSimulation
{

    public enum KeyEventType
    {
        Button = 1,
        Up = 2,
        Down = 4,
        Axis = 8

    }

    //定义事件名字 可作识别码
    public string name = "keyevent";
    // 标记类型
    public string tag = "KeyBoard";
    //目标事件
    public string eventName = "KFE_event0";
    //目标事件分类
    public string type = "TYPE_KFEVENT_GAME";

    //键盘事件类型
    public KeyEventType keyEventType = KeyEventType.Button;
    //定义ID作为识别码
    public int id = 0;
    //按钮名
    public string keyCode;

    //状态， 0是弹起，1是按下
    public int status = 0;

    //带数据
    public int valueInt = 0;
    public float valufloat = 0.0f;
    public string valueString = "";
    public System.Object value;


    public KFEvent GetEvent()
    {
        KFEvent e = new KFEvent();
        e.id = 1000 + id;
        e.name = eventName;
        e.tag = tag;
        e.type = type;
        e.status = status;
        e.keyCode = keyCode;
        e.valueInt = valueInt;
        e.valueString = valueString;
        e.valufloat = valufloat;
        e.value = value;
        return e;
    }
}
